package com.exam.utils;

import java.util.Random;

public class NickNameUtil {

    private static final Random random = new Random();

    public static String getNickName(){
        // 巴西城市/州名
        String[] cities = {"Rio", "Sampa", "BH", "Salvador", "Recife",
                "Curitiba", "PortoAlegre", "Brasilia", "Fortaleza", "Manaus"};

        // 葡萄牙语动词
        String[] verbs = {"Canta", "Danca", "Joga", "Fala", "Come",
                "Bebe", "Ri", "Chora", "Ama", "Sonha"};

        // 巴西动物/自然
        String[] nature = {"Tucano", "Onça", "Amazonia", "Pantanal", "Coco",
                "Manga", "Caju", "Cachaca", "Sertao", "Favela"};

        int pattern = random.nextInt(5);

        switch(pattern) {
            case 0: return getRandom(cities) + getRandom(nature); // RioTucano
            case 1: return getRandom(verbs) + getRandom(nature);  // DancaOnça
            case 2: return "DJ" + getRandom(nature);              // DJAmazonia
            case 3: return getRandom(cities) + random.nextInt(30); // Sampa22
            default: return getRandom(nature) + "De" + getRandom(cities); // OnçaDeRio
        }
    }

    private static String getRandom(String[] array) {
        return array[random.nextInt(array.length)];
    }

    public static void main(String[] args) {
        String nickName = NickNameUtil.getNickName();
        System.out.println(nickName);
    }
}
